package org.adorsys.aderp.cash.domain;

import java.io.Serializable;
import java.math.BigDecimal;
import javax.persistence.Column;
import javax.validation.constraints.NotNull;
import org.springframework.roo.addon.javabean.RooJavaBean;
import org.springframework.roo.addon.jpa.entity.RooJpaEntity;
import org.springframework.roo.addon.tostring.RooToString;

@RooJavaBean
@RooToString
@RooJpaEntity
public class CashRegItem implements Serializable{

    /**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	@NotNull
    @Column(name = "cashRegItemKeyBk", unique = true)
    private String cashRegItemKey;

    @NotNull
    private BigDecimal qty;

    @NotNull
    private BigDecimal unitPrice;

    @NotNull
    private BigDecimal amount;

    private String itemNumber;

    private String itemDesc;

    private String recordOwner;

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((cashRegItemKey == null) ? 0 : cashRegItemKey.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		CashRegItem other = (CashRegItem) obj;
		if (cashRegItemKey == null) {
			if (other.cashRegItemKey != null)
				return false;
		} else if (!cashRegItemKey.equals(other.cashRegItemKey))
			return false;
		return true;
	}
    
}
